<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="../js/jquery-1.11.0.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		//淡出DOM
		$("#b1").click(function(){
			$("#p").fadeOut();
		});
		//淡入DOM
		$("#b2").click(function(){
			$("#p").fadeIn();
		});
		//淡入淡出切换DOM
		$("#b3").click(function(){
			//$("#p").fadeToggle();
			//$("#p").fadeToggle("fast");//设置淡入淡出的时间为快一些
			$("#p").fadeToggle(5000);//设置时间为5s
		});
	});
</script>
</head>
<body>
<input type="button" id="b1" value="淡出"/>
<input type="button" id="b2" value="淡入"/>
<input type="button" id="b3" value="淡入淡出切换"/>
<div id="p" style="width:100px; height:100px; background-color:red; margin:10px;"></div>
</body>
</html>